def merge(left, right):
    result=[]
    while len(left)>0 and len(right)>0:
        if left[0]<=right[0]:
            result.append(left.pop(0))
        else:
            result.append(right.pop(0))

    result+=left
    result+=right
    return result


def merge_sort(lt):
    if len(lt)==1:
        return lt

    mid=len(lt)//2
    left=lt[:mid]
    right=lt[mid:]

    return merge(merge_sort(left),merge_sort(right))

lt = merge_sort([11, 99, 33, 69, 77, 88, 55, 11, 33, 36, 39, 66, 44, 22])
print(lt)